/*! For license information please see 2555.8470a65d42b2b86eb5f6.js.LICENSE.txt */ "use strict";(self.webpackChunkwebpack_frontend=self.webpackChunkwebpack_frontend||[]).push([[2555],{62555:(t,e,r)=>{r.d(e,{A:()=>R});r(23792),r(26099),r(3362),r(27495),r(47764),r(5746),r(62953);var n=r(25106),o=r(9871),i=(r(52675),r(89463),r(66412),r(2259),r(45700),r(78125),r(51629),r(94490),r(34782),r(60739),r(89572),r(94170),r(62010),r(4731),r(60479),r(2892),r(59904),r(84185),r(40875),r(79432),r(10287),r(60825),r(42762),r(23500),r(3223)),a=r(1598),u=r(84786),c=r(33333),l=r(10245),s=r(84634),f=r(74692);function h(){(0,s.TV)("try_login",1,{path:"/"})}(0,s.Ri)("try_login")&&(0,s.zs)("try_login",{path:"/"}),f("body").on("click","#popup-form-login .social-item, #uLogin .social-item",h);var p=r(57767),d=r(33498),y=r(53448),v=r(30200),m=r(89668),g=r(53390),b=r(74692);function w(t){return w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},w(t)}function _(){_=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),u=new j(n||[]);return o(a,"_invoke",{value:S(t,r,u)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",v={};function m(){}function g(){}function b(){}var E={};l(E,a,(function(){return this}));var x=Object.getPrototypeOf,k=x&&x(x(R([])));k&&k!==r&&n.call(k,a)&&(E=k);var T=b.prototype=m.prototype=Object.create(E);function A(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function L(t,e){function r(o,i,a,u){var c=f(t[o],t,i);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==w(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function S(e,r,n){var o=h;return function(i,a){if(o===d)throw Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=O(u,n);if(c){if(c===v)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?y:p,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=y,n.method="throw",n.arg=l.arg)}}}function O(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,O(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function F(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function R(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(c&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),F(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;F(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:R(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function E(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function x(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){E(i,n,o,a,u,"next",t)}function u(t){E(i,n,o,a,u,"throw",t)}a(void 0)}))}}function k(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:"",r=this._getMutationArguments();return e&&(r.gCaptchaResponse=e),h(),(0,l.A)().mutate({mutation:(0,l.$)("auth"),variables:r,fetchPolicy:"no-cache"}).then((function(e){e.data.auth.viewer.id.length&&t.successHandler(e)})).catch((function(e){return!(0,s.KV)()&&console.log(e),t._errorHandler(e.graphQLErrors[0],r),(0,y.Dv)(t.form.querySelector("button[type=submit]")),null}))}},{key:"successHandler",value:(E=x(_().mark((function t(e){var r,n;return _().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=e.data.auth.viewer,n=r.locale.toLowerCase(),p.GTM.login(!0),(0,s.Ri)("crm_auth_hash")&&(0,s.zs)("crm_auth_hash",{path:"/"}),(0,s.zs)("app_install_uuid",{path:"/"}),d.D.redirectByLocale(n);case 6:case"end":return t.stop()}}),t)}))),function(t){return E.apply(this,arguments)})},{key:"_errorHandler",value:function(t,e){var r=t.field_errors,n=t.code,o=t.payload,a=this._getCurrentFormData();"need_two_factors"===n?(0,m.A)(m.Y.TYPES.login,o,this.successHandler,e):r.forEach((function(t){var e;e="password"===t.field?a.password:a.login,i.A.addErrorToElement(b(e),t.errors[0])}))}},{key:"_getMutationArguments",value:function(){var t,e=(0,s.Ri)("id"),r=(0,s.Ri)("sign"),n=(0,s.Ri)("xAppName"),o=(0,s.Ri)("xAppToken"),i=(0,s.Ri)("xDeviceId"),a=(0,s.Ri)("x_mob_app_data"),u=(0,s.Ri)("pmeth"),c=this._getCurrentFormData(),l=this.isPhoneTabSelected(this.state.mutationType)?this._getPhoneValue(this.phoneFields.login):c.login.value,f=null===(t=document.getElementById("login-confirmation-code"))||void 0===t?void 0:t.value,h=(0,s.Ri)("app_install_uuid"),p=(0,s.Ri)("crm_auth_hash"),d=(0,s.Ri)("rec_sum"),y={login:l.trim(),password:c.password.value,code:f||null,platformType:(0,s.mw)(),platform:(0,s.uo)(),refCode:(0,s.Ri)("refCode")||"",affData:(0,s.Ri)("aff_data_cookie")||"",pushSubscriptionData:a,appInstallUuid:h};return p&&(y.crmAuthHash=p),u&&(y.paySystemsGroup=u),e&&r&&(y.dcId=(0,s.Ri)("id"),y.dcSign=(0,s.Ri)("sign")),n&&o&&(y.pushSubscriptionData=JSON.stringify({xAppName:n,xAppToken:o,xDeviceId:i})),d&&(y.recommendedSum=d),y}},{key:"_getCurrentFormData",value:function(){return this.isPhoneTabSelected(this.state.mutationType)?this.phoneFields:this.emailFields}},{key:"_getPhoneValue",value:function(t){return v.Ay.getFullPhoneNumber(t)}},{key:"_validateForm",value:(w=x(_().mark((function t(){var e,r=this;return _().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.isValidForm=!0,t.next=3,null===(e=this.form.querySelectorAll("[data-fld]:not([data-no-validate-input])"))||void 0===e?void 0:e.forEach((function(t){var e,n=null===(e=t.value)||void 0===e?void 0:e.trim();r.validator.isEmpty(t)?(i.A.addErrorToElement(t,(0,c.A)("empty-field")),r.isValidForm=!1):(t===r.emailFields.login&&(a.A.isEmail(n)||(i.A.addErrorToElement(t,(0,c.A)("enter-correct-login")),r.isValidForm=!1)),t===r.phoneFields.login&&(r.validator.isCorrectPhone(t)||(i.A.addErrorToElement(t,(0,c.A)("enter-correct-phone")),r.isValidForm=!1)))}));case 3:case"end":return t.stop()}}),t,this)}))),function(){return w.apply(this,arguments)})},{key:"_attachEvents",value:function(){var t=this;this.form.addEventListener("submit",(function(e){e.preventDefault(),t.submitButton&&(0,y.Q_)(t.submitButton),t._validateForm().then((function(){if(!t.isValidForm)return!1;if(0!==Object.keys(t.captchaData).length&&t.captchaData.enabled){var e=Math.ceil(1e3*Math.random());o.q.render(t.form.querySelector("button[type=submit]"),t.captchaData.captchaId,e,(function(e){var r=e.token;t._sendForm(r)})).execute(e)}else t._sendForm()}))})),document.addEventListener(g.A.AUTH_TABS_TRIGGER,(function(e){t.state.mutationType=t.mutationTypes[e.detail.activeTab],t.changeActiveInputField(t.state.mutationType)}))}}],n&&k(r.prototype,n),f&&k(r,f),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,f,w,E}(g.A),F=r(57356);function j(t){var e=t.trackAuthAnalytics,r=t.trackConstant;t.trackTools.checkTafficMatch(),e(r.popupLogin())}const R={hash:"#popup-login",url:window.location.search?"/get-login-form/".concat(window.location.search):"/get-login-form/",handler:function(t){Promise.resolve().then(r.bind(r,57767)).then(j),(0,o.A)(o.q.type.login).then((function(t){new P(t)})),(0,F.A)().then((function(){var t=document.querySelector("[data-login-page]")?"[login-data]":".popup [login-data]";F.C.customInit(t)}));var e='[data-popup="header"] [data-lang-switcher-wrap]';(0,s.z1)(e).then((function(t){t&&r.e(956).then(r.bind(r,60956)).then((function(t){return t&&t.default(e)}))})),(0,n.A)("#sign-in-password"),g.A.authorizationPopupsTabsHandler(),t&&t()}}}}]);